#ifndef GAME_H
#define GAME_H

#include "IrrEngine.h"
#include "FmodEngine.h"
#include "GameState.h"
#include "Singleton.h"
#include <vector>

class Game
{
public:

	void Init(const char* title, int width, int height, 
		int bpp, bool fullscreen);

	void Cleanup();

	void ChangeState(GameState* state);
	void PushState(GameState* state);
	void PopState();

	bool HandleEvents(const SEvent& event);
	void Update();
	void Draw();

	bool Running() { return m_running; }
	void Quit() { m_running = false; }

	double GetDt(){return m_dt;}

private:

	Game() { }
	friend class Singleton<Game>;
	// the stack of states
	std::vector<GameState*> states;
	bool m_running;
	stringw m_Title;
	int m_lastFPS;
	double m_lastTime;
	double m_dt;
};

typedef Singleton<Game> TheGame;

#endif // GAME_H